package com.taptech.doufu.ui.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.NonNull;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.taptech.doufu.R;

/**
 * Created by Wyatt on 2017/9/18/018.
 */

public class PublishTipSingleBtnDialog extends Dialog{
    private TextView tvContent;
    private LinearLayout llSure;
    private String content;
    private OnClickBtn onClickBtn;

    public interface OnClickBtn{
        void onClickBtn();
    }

    public PublishTipSingleBtnDialog(@NonNull Context context, int theme, String content) {
        super(context,theme);
        this.content = content;
    }

    public void setOnClickBtn(OnClickBtn onClickBtn) {
        this.onClickBtn = onClickBtn;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.publish_tip_dialog_single_btn);
        tvContent = (TextView) findViewById(R.id.tvContent);
        tvContent.setText(content);
        setCanceledOnTouchOutside(false);

        llSure = (LinearLayout) findViewById(R.id.llSure);
        llSure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onClickBtn.onClickBtn();
                dismiss();
            }
        });
    }
}
